﻿<?php
include("../Modules/admin_resist_mdl.php");
// include('doctype.htm');
?>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript" type="text/javascript"> 
	

</script>

</head>

<body>
<script language="javascript">
	
	// Kiem tra cac truong trong form co bi bo trong hay khong
	function emptyCheck()
	{
		if ( (document.frmEditGV.txtMSCB.value == "")  ||
			 (document.frmEditGV.txtTenCB.value == "")	)
		
				document.frmEditGV.smtGV.disabled = true;
		
		else document.frmEditGV.smtGV.disabled = false;
	}
	
</script>

<h4>Sửa thông tin bộ môn</h4>

<?php
	include("../../Modules/conn.php");
	
	$mscb = @$_GET["mscb"];
	$query1 = "select * from giang_vien where MSCB = '$mscb'";
	$result1 = mysql_query($query1);
	$row1 = mysql_fetch_array($result1);
?>

<form method="POST" action="../Modules/admin_editgv.php?mscb=<?php echo $mscb; ?>" name="frmEditGV" onreset="this.smtGV.disabled = true">
	<ul>
		<li>
			<span>Mã cán bộ</span>
			<input type="text" name="txtMSCB" value="<?php echo $row1['MSCB']; ?>" onkeyup="emptyCheck();">
		</li>
		
		<li>
			<span>Tên cán bộ</span>
			<input type="text" name="txtTenCB" value="<?php echo $row1['TEN_CB']; ?>" onkeyup="emptyCheck();">
		</li>
		
		<li>
			<span>Bộ môn</span>
			<select name="cboBM" onchange="emptyCheck();">
				<?php
					$query2 = "select * from bo_mon";
					$result2 = mysql_query($query2, $conn) or die(mysql_error());
					while ($row2 = mysql_fetch_array($result2))
					{
						echo '<option value="'.$row2['MSBM'].'"';
						
						// Dat gia tri combobox la gia tri trong csdl
						if ($row1['MSBM'] == $row2['MSBM'])
							echo " selected";
						
						echo '>'.$row2['TEN_BM'].'</option>';
					}
				?>
			</select>
		</li>
		
		<li>
			<input type="submit" value="Lưu" name="smtGV" disabled="true">
			<input type="reset" value="Nhập lại" name="resGV">
		</li>
	</ul>
</form>

</body>

</html>